program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
    pelement = ^element;
    element = record
        value : Integer;
        next : pelement;
    end;
var
  head : pelement;
  N, I, A : Integer;

procedure write_list() ;
var
  x : pelement;
begin
  x := head;
  while(x <> nil)  do begin
      writeln(x^.value);
      x := x^.next;
  end;
end;

procedure add_to_end(x : Integer);
  var
    a, b : pelement;
begin
  a := head;
  if(a <> nil) then Begin
    while(a^.next <> nil) do
      a := a^.next;
    New(b);
    a^.next := b;
    b^.next:= nil;
    b^.value := x;end
  else Begin
    new(a);
    a^.value := x;
    a^.next := nil;
    head := a;end;

end;
var
  q : Integer;
begin
  head := nil;
  Readln(N);
  for I := 0 to N - 1 do begin
     Readln(q);
     add_to_end(q);

  end;
  write_list();
  Readln;
  Readln;
  Readln;
end.
